<template>
    <div id="aftersearch">
        <van-row type="flex" justify="start">
            <van-nav-bar left-arrow @click-left="onClickLeft"/>
            <van-search placeholder="休闲鞋" @search="onSearch"/>
        </van-row>
        <van-dropdown-menu>
            <van-dropdown-item v-model="value1" :options="option1" />
            <van-dropdown-item v-model="value2" :options="option2" />
            <van-dropdown-item v-model="value3" :options="option3" />
        </van-dropdown-menu>
        <div class="goodslist" v-for="(goods,index) in goodslist" :key="index">
            <van-card :price="goods.price" :desc="goods.desc" :title="goods.title" :thumb="'../../../static/img/'+goods.img" @click="click"/>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            value1: 0,
            value2: 0,
            value3: 0,
            option1: [
                { text: '综合', value: 0 },
                { text: '信用', value: 1 },
                { text: '价格降序', value: 2 },
                { text: '价格升序', value: 3 }
            ],
            option2: [
                { text: '销量', value: 0 },
                { text: '降序', value: 1 },
                { text: '升序', value: 2 }
            ],
            option3: [
                { text: '价格', value: 0 },
                { text: '低', value: 1 },
                { text: '中', value: 2 },
                { text: '高', value: 3 }
            ],
            goodslist:[
                {
                    id:1000,
                    price:233,
                    img:'goodsdemo.jpg',
                    desc:'2019 新款',
                    title:'New Balance'
                },
                {
                    id:2,
                    price:'233',
                    img:'goodsdemo.jpg',
                    desc:'2019 新款',
                    title:'New Balance'
                },
                {
                    id:1001,
                    price:233,
                    img:'goodsdemo.jpg',
                    desc:'2019 新款',
                    title:'New Balance'
                },
                {
                    id:1002,
                    price:233,
                    img:'goodsdemo.jpg',
                    desc:'2019 新款',
                    title:'New Balance'
                },
                {
                    id:1003,
                    price:233,
                    img:'goodsdemo.jpg',
                    desc:'2019 新款',
                    title:'New Balance'
                },
                {
                    id:1004,
                    price:233,
                    img:'goodsdemo.jpg',
                    desc:'2019 新款',
                    title:'New Balance'
                }
            ]
        }
    },
    methods: {
        onClickLeft() {
            this.$router.push({ path: 'home' })
        },
        onSearch() {
            this.$router.push({ path: "aftersearch" });
        },
        click(){
            this.$router.push({ path: 'commoditypage' })
        }
    }
}
</script>

<style scoped  lang="">
.van-nav-bar .van-icon {
    color: #ff6341;
}
.van-search{
    width:8rem;
    margin-left:1rem;
}
.van-divider{
    margin:0;
}
.goodslist .van-card{
    margin:0.1rem 0;
}
</style>

